package Animal;
/*
猫有名字,体重,体力等属性,老鼠有名字,体力等属性
如果老鼠被猫抓住,被咬死,猫体力上涨,老鼠体力变成0;
 */

public class Cat {
    private String name;
    private int weight;
    private int power;

    public Cat() {

    }

    public Cat(String name, int weight, int power) {
        this.name = name;
        this.weight = weight;
        this.power = power;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getWeight() {
        return weight;
    }

    public void setWeight(int weight) {
        this.weight = weight;
    }

    public int getPower() {
        return power;
    }

    public void setPower(int power) {
        this.power = power;
    }


    public void grad(Mouse a) {

        System.out.println("这只叫" + name + "的猫，体重为" + weight + "kg ，抓到并且咬死了这只叫" + a.getName() + "的老鼠");
        power += a.getPower();
        a.setPower(0);

        System.out.println(name + "的体力值上涨为" + power + "," + a.getName() + "的体力值为" + a.getPower());


    }


}
